{template 'public/header'}
{template 'public/comhead'}

<ul class="nav nav-tabs">
    <li class="active"><a href="#">系统设置</a></li>
    {if $_W['isfounder']}
    <li><a href="{php echo $this->createWebUrl('stores', array('op' => 'setting'))}">站长设置</a></li>
    {/if}
    <!--<li {if $operation == 'display'}class="active"{/if}><a href="{php echo $this->createWebUrl('nave', array('op' => 'display'))}">管理首页导航</a></li>-->
</ul>

<script type="text/javascript">
    $(function(){
        $(':radio[name="ismail"]').click(function(){
            if(this.checked) {
                if($(this).val() == '1') {
                    $('.mail').show();
                } else {
                    $('.mail').hide();
                }
            }
        });
        $(':radio[name="sms_enable"]').click(function(){
            if(this.checked) {
                if($(this).val() == '1') {
                    $('.sms').show();
                } else {
                    $('.sms').hide();
                }
            }
        })
        $(':radio[name="isprint"]').click(function(){
            if(this.checked) {
                if($(this).val() == '1') {
                    $('.print').show();
                } else {
                    $('.print').hide();
                }
            }
        });
    });
</script>
<link rel="stylesheet" type="text/css" href="../addons/weisrc_dish/plugin/clockpicker/clockpicker.css" media="all">
<script type="text/javascript" src="../addons/weisrc_dish/plugin/clockpicker/clockpicker.js"></script>
<link rel="stylesheet" type="text/css" href="../addons/weisrc_dish/plugin/clockpicker/standalone.css" media="all">
<div class="main">
    <div class="panel panel-default">
        <div class="panel-body">
            <ul class="nav nav-pills">
                <li role="presentation" class="active"><a href="#tab_basic" aria-controls="tab_basic" role="tab" data-toggle="pill">基本设置</a></li>
                <li role="presentation" class=""><a href="#tab_paytype" aria-controls="tab_paytype" role="tab" data-toggle="pill">支付方式</a></li>
                <li role="presentation" class=""><a href="#tab_info" aria-controls="tab_info" role="tab" data-toggle="pill">信息通知</a></li>
                <li role="presentation" class=""><a href="#tab_price" aria-controls="tab_price" role="tab" data-toggle="pill">商户提现</a></li>
                <li role="presentation" class=""><a href="#tab_commission" aria-controls="tab_commission" role="tab" data-toggle="pill">分销设置</a></li>
                <li role="presentation" class=""><a href="#tab_link" aria-controls="tab_link" role="tab" data-toggle="pill">自定义链接</a></li>
            </ul>
        </div>
    </div>
	<form action="" method="post" class="form-horizontal form" enctype="multipart/form-data">
        <div class="tab-content">
            <div class="tab-pane  active" id="tab_basic">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        基本设置
                    </div>
                    <div class="panel-body">
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">网站名称</label>
                            <div class="col-sm-9">
                                <input type="text" name="title" value="{$setting['title']}" class="form-control"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">搜索关键字设置</label>
                            <div class="col-sm-9">
                                <input type="text" name="searchword" value="{$setting['searchword']}" class="form-control"/>
                                <div class="help-block">多个搜索关键词请用空格符号分开</div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">用户是否需要关注</label>
                            <div class="col-sm-9">
                                <label for="isneedfollow1" class="radio-inline"><input type="radio" name="isneedfollow" value="1" id="isneedfollow1" {if $setting['isneedfollow']==1}checked{/if} /> 是</label>
                                <label for="isneedfollow2" class="radio-inline"><input type="radio" name="isneedfollow" value="0" id="isneedfollow2"  {if $setting['isneedfollow']==0 || empty($setting)}checked{/if} /> 否</label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">引导关注网址</label>
                            <div class="col-sm-9">
                                <input type="text" name="follow_url" value="{$setting['follow_url']}" class="form-control"/>
                                <div class="help-block">引导关注的链接! 推荐用微信平台的素材库，转成短地址。<a target="_blank" href="http://www.dwz.cn/">短网址转换</a></div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">是否开启语音提示</label>
                            <div class="col-sm-9">
                                <label for="is_speaker1" class="radio-inline"><input type="radio" name="is_speaker" value="1" id="is_speaker1" {if $setting['is_speaker']==1}checked{/if} /> 开启</label>
                                <label for="is_speaker2" class="radio-inline"><input type="radio" name="is_speaker" value="0" id="is_speaker2"  {if $setting['is_speaker']==0 || empty($setting)}checked{/if} /> 关闭</label>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="panel panel-default">
                    <div class="panel-heading">
                        模式
                    </div>
                    <div class="panel-body">
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">模式</label>
                            <div class="col-sm-9">
                                <label for="mode2" class="radio-inline"><input type="radio" name="mode" value="0" id="mode2"  {if empty($setting) || $setting['mode'] == 0}checked="true"{/if} /> 多店</label>
                                <label for="mode1" class="radio-inline"><input type="radio" name="mode" value="1" id="mode1" {if $setting['mode'] == 1}checked="true"{/if} /> 单店</label>
                                <span class="help-block">选择单店模式的情况下搜索页和门店搜索栏目将会隐藏</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">默认门店</label>
                            <div class="col-sm-9">
                                <select id="storeid" name="storeid" class="form-control">
                                    {loop $stores $item}
                                    <option value="{$item['id']}" {if $item['id']==$setting['storeid']}selected{/if}>{$item['title']}</option>
                                    {/loop}
                                </select>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="panel panel-default">
                    <div class="panel-heading">
                        分享设置
                    </div>
                    <div class="panel-body">
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label"><span style='color:red'>*</span> 分享标题</label>
                            <div class="col-sm-9 col-xs-12">
                                <input type="text" id="share_title" class="form-control" placeholder="" name="share_title" value="{$setting['share_title']}">
                                <div class="help-block">
                                    分享的文字，用户显示分享给用户的介绍!<br/>
                                    #username#为分享出去用户昵称
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label"><span style='color:red'>*</span> 分享图片</label>
                            <div class="col-sm-9 col-xs-12">
                                {php echo tpl_form_field_image('share_image',$setting['share_image']);}
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label"><span style='color:red'>*</span> 分享描述</label>
                            <div class="col-sm-9 col-xs-12">
                                <textarea style="height:60px;" name="share_desc" class="form-control" cols="60">{$setting['share_desc']}</textarea>
                                <div class="help-block">
                                    #username#为分享出去用户昵称
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="tab-pane" id="tab_paytype">
                <div class="alert alert-info">
                    <h4>在开启以下支付方式前，请到 <a href="./index.php?c=profile&a=payment" target="_blank">支付选项</a>去设置好参数。</h4>
                </div>
                <div class="panel panel-default">
                    <div class="panel-heading">
                        支付方式设置
                    </div>
                    <div class="panel-body">
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">微信支付</label>
                            <div class="col-sm-9">
                                <label for="wechat1" class="radio-inline"><input type="radio" name="wechat" id="wechat1" value="1" {if $setting['wechat'] == 1}checked="true"{/if} /> 开启</label>
                                <label for="wechat2" class="radio-inline"><input type="radio" name="wechat" value="0" id="wechat2"  {if empty($setting) || $setting['wechat'] == 0}checked="true"{/if} /> 关闭</label>
                                <span class="help-block"></span>
                            </div>
                        </div>
                    </div>
                    <div class="panel-body">
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">支付宝</label>
                            <div class="col-sm-9">
                                <label for="alipay1" class="radio-inline"><input type="radio" name="alipay" id="alipay1" value="1" {if $setting['alipay'] == 1}checked="true"{/if} /> 开启</label>
                                <label for="alipay2" class="radio-inline"><input type="radio" name="alipay" value="0" id="alipay2"  {if empty($setting) || $setting['alipay'] == 0}checked="true"{/if} /> 关闭</label>
                                <span class="help-block"></span>
                            </div>
                        </div>
                    </div>
                    <div class="panel-body">
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">余额支付</label>
                            <div class="col-sm-9">
                                <label for="credit1" class="radio-inline"><input type="radio" name="credit" id="credit1" value="1" {if $setting['credit'] == 1}checked="true"{/if} /> 开启</label>
                                <label for="credit2" class="radio-inline"><input type="radio" name="credit" value="0" id="credit2"  {if empty($setting) || $setting['credit'] == 0}checked="true"{/if} /> 关闭</label>
                                <span class="help-block"></span>
                            </div>
                        </div>
                    </div>
                    <div class="panel-body">
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">货到付款</label>
                            <div class="col-sm-9">
                                <label for="delivery1" class="radio-inline"><input type="radio" name="delivery" id="delivery1" value="1" {if $setting['delivery'] == 1}checked="true"{/if} /> 开启</label>
                                <label for="delivery2" class="radio-inline"><input type="radio" name="delivery" value="0" id="delivery2"  {if empty($setting) || $setting['delivery'] == 0}checked="true"{/if} /> 关闭</label>
                                <span class="help-block"></span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="tab-pane" id="tab_info">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        管理员信息提醒设置
                    </div>
                    <div class="panel-body">
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">是否信息提醒</label>
                            <div class="col-sm-9">
                                <label for="is_notice1" class="radio-inline"><input type="radio" name="is_notice" value="1" id="is_notice1" {if $setting['is_notice'] == 1}checked="true"{/if} /> 是</label>
                                &nbsp;&nbsp;&nbsp;
                                <label for="is_notice2" class="radio-inline"><input type="radio" name="is_notice" value="0" id="is_notice2"  {if empty($setting) || $setting['is_notice'] == 0}checked="true"{/if} /> 否</label>
                                <span class="help-block"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">通知用户OPENID</label>
                            <div class="col-sm-9">
                                <input type="text" name="tpluser" class="form-control" value="{$setting['tpluser']}"/>
                                <span class="help-block">请填写微信编号。系统根据微信编号获取对应公众号的openid,多个管理员请用','符号分开</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">邮箱</label>
                            <div class="col-sm-9">
                                <input type="text" name="email" class="form-control" value="{$setting['email']}" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">手机号</label>
                            <div class="col-sm-9">
                                <input type="text" name="sms_mobile" class="form-control" value="{$setting['sms_mobile']}" />
                                <div class="help-block">请输入要接受订单提醒的手机号码.</div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="panel panel-default">
                    <div class="panel-heading">
                        模版消息通知
                    </div>
                    <div class="panel-body">
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">是否开启</label>
                            <div class="col-sm-9">
                                <label for="isshow1" class="radio-inline"><input type="radio" name="istplnotice" value="1" id="isshow1" {if $setting['istplnotice'] == 1}checked="true"{/if} /> 是</label>
                                &nbsp;&nbsp;&nbsp;
                                <label for="isshow2" class="radio-inline"><input type="radio" name="istplnotice" value="0" id="isshow2"  {if empty($setting) || $setting['istplnotice'] == 0}checked="true"{/if} /> 否</label>
                                <span class="help-block"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">行业类型</label>
                            <div class="col-sm-9">
                                <label for="tpltype1" class="radio-inline"><input type="radio" name="tpltype" value="1" id="tpltype1" {if empty($setting) || $setting['tpltype'] == 1}checked="true"{/if} /> 餐饮</label>
                                &nbsp;&nbsp;&nbsp;
                                <label for="tpltype2" class="radio-inline"><input type="radio" name="tpltype" value="2" id="tpltype2"  {if $setting['tpltype'] == 2}checked="true"{/if} /> IT科技</label>
                                <span class="help-block"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">订单状态提醒模版ID</label>
                            <div class="col-sm-9">
                                <input type="text" name="tplneworder" value="{$setting['tplneworder']}" class="form-control"/>
                                <div class="help-block">
                                    a.<code>餐饮行业</code>在模板库选择行业<code>餐饮－餐饮</code>，搜索“<code>订单状态提醒</code>”编号为<code>OPENTM202045454</code>的模板<br/>
                                    b.<code>IT科技行业</code>在模板库选择行业<code>IT科技－互联网|电子商务</code>，搜索“<code>订单状态提醒</code>”编号为<code>OPENTM206848054</code>的模板
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">排队通知模版ID</label>
                            <div class="col-sm-9">
                                <input type="text" name="tplnewqueue" value="{$setting['tplnewqueue']}" class="form-control"/>
                                <div class="help-block">
                                    a.<code>餐饮行业</code>在模板库选择行业<code>餐饮－餐饮</code>，搜索“<code>排号通知</code>”编号为<code>OPENTM383288748</code>的模板<br/>
                                    b.<code>IT科技行业</code>在模板库选择行业<code>IT科技－互联网|电子商务</code>，搜索“<code>排号提醒通知</code>”编号为<code>OPENTM205984119</code>的模板
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">呼叫服务员模版ID</label>
                            <div class="col-sm-9">
                                <input type="text" name="tploperator" value="{$setting['tploperator']}"
                                       class="form-control"/>
                                <div class="help-block">
                                    a.<code>餐饮行业</code>在模板库选择行业<code>餐饮－餐饮</code>，搜索“<code>呼叫服务员提醒</code>”编号为<code>OPENTM400182254</code>的模板<br/>
                                    b.<code>IT科技行业</code>在模板库选择行业<code>IT科技－互联网|电子商务</code>，搜索“<code>服务状态提醒</code>”编号为<code>OPENTM401684051</code>的模板
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="panel panel-default">
                    <div class="panel-heading">
                        邮件设置
                    </div>
                    <div class="panel-body">
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">邮箱提醒</label>
                            <div class="col-sm-9">
                                <label for="email_enable" class="radio-inline"><input type="radio" name="email_enable" value="1" id="email_enable" {if $setting['email_enable']==1}checked{/if} /> 是</label>
                                &nbsp;&nbsp;&nbsp;
                                <label for="email_enable2" class="radio-inline"><input type="radio" name="email_enable" value="0" id="email_enable2"  {if $setting['email_enable']==0 || empty($setting)}checked{/if} /> 否</label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">邮箱服务器</label>
                            <div class="col-sm-9">
                                <select name="email_host" class="form-control">
                                    <option value="smtp.qq.com" {if $setting['email_host'] == 'smtp.qq.com' } selected="selected"{/if}>QQ邮箱</option>
                                    <option value="smtp.126.com" {if $setting['email_host'] == 'smtp.126.com' } selected="selected"{/if}>126邮箱</option>
                                    <option value="smtp.163.com" {if $setting['email_host'] == 'smtp.163.com' } selected="selected"{/if}>163邮箱</option>
                                    <option value="smtp.sina.com" {if $setting['email_host'] == 'smtp.sina.com' } selected="selected"{/if}>sina邮箱</option>
                                </select>
                                <div class="help-block">QQ邮箱务必开启smtp服务</div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">发件人名称</label>
                            <div class="col-sm-9">
                                <input type="text" name="email_user" class="form-control" value="{if empty($setting['email_user']) || empty($setting)}微点餐{else}{$setting['email_user']}{/if}" />
                                <div class="help-block">指定发送邮件发信人名称</div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">发送帐号用户名</label>
                            <div class="col-sm-9">
                                <input type="text" name="email_send" class="form-control" value="{$setting['email_send']}" />
                                <div class="help-block">指定发送邮件的用户名，例如：123456@qq.com</div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">发送帐号密码</label>
                            <div class="col-sm-9">
                                <input type="password" name="email_pwd" class="form-control" value="{$setting['email_pwd']}" />
                                <div class="help-block">指定发送邮件的密码<code>163邮箱记得填授权密码</code></div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="panel panel-default">
                    <div class="panel-heading">
                        短信设置
                    </div>
                    <div class="panel-body">
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">商户短信提醒</label>
                            <div class="col-sm-9">
                                <label for="sms_enable" class="radio-inline"><input type="radio" name="sms_enable" value="1" id="sms_enable" {if $setting['sms_enable']==1}checked{/if} /> 是</label>
                                &nbsp;&nbsp;&nbsp;
                                <label for="sms_enable2" class="radio-inline"><input type="radio" name="sms_enable" value="0" id="sms_enable2"  {if $setting['sms_enable']==0 || empty($setting)}checked{/if} /> 否</label>
                                <div>
                                    使用短信提醒必须申请接口才能使用 <a href="http://www.dxton.com/" target="_blank">申请网址查看这里</a>.
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">短信平台帐号</label>
                            <div class="col-sm-9">
                                <input type="text" name="sms_username" class="form-control" value="{$setting['sms_username']}" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">短信平台密码</label>
                            <div class="col-sm-9">
                                <input type="password" name="sms_pwd" class="form-control" value="{$setting['sms_pwd']}" />
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="tab-pane" id="tab_price">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        提现设置
                    </div>
                    <div class="panel-body">
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label">最低提现金额</label>
                            <div class="col-sm-6 col-md-8 col-xs-12">
                                <div class="input-group ">
                                    <input type="text" name="getcash_price" class="form-control" value="{$setting['getcash_price']}">
							<span class="input-group-btn">
								<button class="btn btn-default" type="button">元</button>
							</span>
                                </div>
                                <span class="help-block">最低提现金额不能小于1元，建议填写整数，不填写为不限制</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label">提现费率</label>
                            <div class="col-sm-6 col-md-8 col-xs-12">
                                <div class="input-group ">
                                    <input type="text" name="fee_rate" class="form-control" value="{$setting['fee_rate']}">
							<span class="input-group-btn">
								<button class="btn btn-default" type="button">%</button>
							</span>
                                </div>
						<span class="help-block">商户申请提现时，每笔申请提现扣除的费用，默认为空，即提现不扣费，支持填写小数<br>
						<span style="color: red">门店默认提现费率</span>
						</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label">提现费用</label>
                            <div class="col-sm-6 col-md-8 col-xs-12">
                                <div class="input-group">
							<span class="input-group-btn">
								<button class="btn btn-default" type="button">最低</button>
							</span>
                                    <input type="text" name="fee_min" class="form-control"  value="{$setting['fee_min']}">
							<span class="input-group-btn">
								<button class="btn btn-default" type="button">元</button>
							</span>
                                </div>
                                <div class="input-group" style="margin-top: .5rem">
							<span class="input-group-btn">
								<button class="btn btn-default" type="button">最高</button>
							</span>
                                    <input type="text" name="fee_max" class="form-control" value="{$setting['fee_max']}">
							<span class="input-group-btn">
								<button class="btn btn-default" type="button">元</button>
							</span>
                                </div>
						<span class="help-block">商户提现时，提现费用的上下限，最高为空时，表示不限制扣除的提现费用<br>
							例如：提现100元，费率5%，最低1元，最高2元，商户最终提现金额=100-2=98<br>
							例如：提现100元，费率5%，最低1元，最高10元，商户最终提现金额=100-100*5%=95<br>
						<span style="color: red">门店默认提现费用</span>
						</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="tab-pane" id="tab_commission">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        分销设置 <a href="{php echo $this->createWebUrl('commission', array('op' => 'display'))}">佣金管理</a>
                    </div>
                    <div class="panel-body">
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">是否开启分销</label>
                            <div class="col-sm-9">
                                <label for="is_commission1" class="radio-inline"><input type="radio" name="is_commission" value="1" id="is_commission1" {if $setting['is_commission'] == 1}checked="true"{/if} /> 是</label>
                                &nbsp;&nbsp;&nbsp;
                                <label for="is_commission2" class="radio-inline"><input type="radio" name="is_commission" value="0" id="is_commission2"  {if empty($setting) || $setting['is_commission'] == 0}checked="true"{/if} /> 否</label>
                                <span class="help-block"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label">分销层级</label>
                            <div class="col-sm-8 col-md-8 col-xs-12">
                                <select class="form-control" name="commission_level">
                                    <option value="1" {if $setting['commission_level']==1}selected{/if}>一级分销</option>
                                    <option value="2" {if $setting['commission_level']==2}selected{/if}>二级分销</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-2 col-md-2 control-label">一级分销佣金</label>
                            <div class="col-sm-6 col-md-8 col-xs-12">
                                <div class="input-group" style="margin-bottom: .5rem">
                                    <span class="input-group-addon">最高</span>
                                    <input type="number" step="0.01" class="form-control" value="{$setting['commission1_rate_max']}" name="commission1_rate_max">
                                    <span class="input-group-addon">%</span>
                                </div>
                                <div class="input-group">
                                    <span class="input-group-addon">最高</span>
                                    <input type="number" step="0.01" class="form-control" value="{$setting['commission1_value_max']}" name="commission1_value_max">
                                    <span class="input-group-addon">元</span>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-2 col-md-2 control-label">二级分销佣金</label>
                            <div class="col-sm-6 col-md-8 col-xs-12">
                                <div class="input-group" style="margin-bottom: .5rem">
                                    <span class="input-group-addon">最高</span>
                                    <input type="number" step="0.01" class="form-control" value="{$setting['commission2_rate_max']}" name="commission2_rate_max">
                                    <span class="input-group-addon">%</span>
                                </div>
                                <div class="input-group">
                                    <span class="input-group-addon">最高</span>
                                    <input type="number" step="0.01" class="form-control" value="{$setting['commission2_value_max']}" name="commission2_value_max">
                                    <span class="input-group-addon">元</span>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label">佣金结算</label>
                            <div class="col-sm-6 col-md-8 col-xs-12">
                                <div class="input-group">
                                    <label class="radio-inline">
                                        <input type="radio" name="commission_settlement" value="1" {if $setting['commission_settlement']==1}checked="true"{/if} /> 自动
                                    </label>
                                    <label class="radio-inline">
                                        <input type="radio" name="commission_settlement" value="0" {if empty($setting) || $setting['commission_settlement'] == 0}checked="true"{/if} /> 手动
                                    </label>
                                </div>
                                <span class="help-block">自动结算佣金：当订单完成后，分销佣金自动进入相应用户的余额里面；</span>
                                <span class="help-block">手动结算佣金：进入佣金管理列表，选择佣金结算并提交，需人工参与操作佣金结算；</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="tab-pane" id="tab_link">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        手机端用户中心<code>(不填默认为自带会员卡链接)</code>
                    </div>
                    <div class="panel-body">
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">会员卡名称</label>
                            <div class="col-sm-9">
                                <input type="text" name="link_card_name" class="form-control" value="{$setting['link_card_name']}" />
                                <div class="help-block"></div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">会员卡链接</label>
                            <div class="col-sm-9">
                                <input type="text" name="link_card" class="form-control" value="{$setting['link_card']}" />
                                <div class="help-block"></div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">签到名称</label>
                            <div class="col-sm-9">
                                <input type="text" name="link_sign_name" class="form-control" value="{$setting['link_sign_name']}" />
                                <div class="help-block"></div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">签到链接</label>
                            <div class="col-sm-9">
                                <input type="text" name="link_sign" class="form-control" value="{$setting['link_sign']}" />
                                <div class="help-block"></div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="form-group col-sm-12">
            <input type="hidden" name="id" value="{$setting['id']}" />
            <input type="submit" name="submit" value="保存设置" class="btn btn-primary col-lg-1" />
            <input type="hidden" name="token" value="{$_W['token']}" />
        </div>
	    <input type="hidden" name="id" value="{$setting['id']}" />
	</form>
</div>
{template 'common/footer'}